import java.util.*;

public class Demo3 {

        public static void Mouse(int n,String str) {

            //页数
            int dex = 1;

            //光标
            int index = 1;
            if(n <= 4) {

                for(int i = 0; i < str.length(); i++) {
                    char ch = str.charAt(i);


                    if(index == 1 && ch == 'U') {
                        index = n;
                    }else if(index == n && ch == 'D') {
                        index = 1;
                    }else if(ch == 'U') {
                        index--;
                    }else if(ch == 'D') {
                        index++;
                    }
                }

                for(int j = 1; j < n; j++) {
                    System.out.print(j + " ");
                }

                System.out.println(n);
                System.out.println(index);
            }else {
                for(int i = 0; i < str.length(); i++) {
                    char ch = str.charAt(i);

                    if(index == 1 && dex == 1 && ch == 'U') {
                        index = n;
                        dex = n - 3;
                    }else if(index == n && dex == n - 3 && ch == 'D') {
                        index = 1;
                        dex = 1;
                    } else if(dex != 1 && index == dex && ch == 'U') {
                        index--;
                        dex--;
                    }else if(dex != n - 3 && index == dex + 3 && ch == 'D') {
                        index++;
                        dex++;
                    }else if(ch == 'D') {
                        index++;
                    }else if(ch == 'U') {
                        index--;
                    }
                }

                for(int i = dex; i < dex + 3; i++) {
                    System.out.print(i + " ");
                }

                System.out.println(dex + 3);
                System.out.println(index);
            }
        }


        public static void main(String[] args) {
            Scanner scan = new Scanner(System.in);
            int n = scan.nextInt();
            String str = scan.next();
            Mouse(n,str);
        }
}

